/**
 * 
 */
package net.toocruel.iqismart.service.core;

import net.toocruel.iqismart.dao.condition.QuestionsCondition;
import net.toocruel.iqismart.entity.core.Question;
import net.toocruel.iqismart.entity.core.QuestionInvitation;
import net.toocruel.iqismart.entity.rbac.User;
import net.toocruel.iqismart.security.core.support.Result;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import javax.mail.MessagingException;
import java.util.List;

/**
 * 角色服务
 * 
 * @author toocruel
 *
 */
public interface QuestionService {


  Question findById(Long id);
  Question findById(Long id,User user);

  List<Question> getSuggests(String word);

  Question postQuestion(Question question);

  Question editQuestion(Question question);

  Result getRecommentInviteUsers(Long questionId, String word);

  Result inviteUser(Long id, Long userId) throws MessagingException;

  Result inviteEmail(Long id, String sendTo) throws MessagingException;

  Page<QuestionInvitation> getInvitations(Long id);

  Page<Question> findAll(QuestionsCondition condition, PageRequest pageRequest);

    void addViews(Question question);

    List<Question> getLatestQuestions(int i);

  List<Question> getLatestRewardQuestions(int i);
}
